package filetest;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * User: leep
 * Date: 16-2-26
 * Time: 下午1:18
 * To change this template use File | Settings | File Templates.
 */
public class FileTest {
	public static void main(String[] args) throws IOException {
		File a = new File("D:/webroot/test/src/filetest/a.txt");
		File b = new File("D:/webroot/test/src/filetest/b.txt");
		BufferedReader ar = new BufferedReader(new FileReader(a));
		BufferedReader br = new BufferedReader(new FileReader(b));
		String aString = "";
		String bString = "";
		String tempString = null;
		while ((tempString = ar.readLine()) != null) {
			aString += tempString + "\n";
		}

		while ((tempString = br.readLine()) != null) {
			bString += tempString + "\n";
		}
		aString += "\n";
		bString = " " + bString;
		File c = new File("D:/webroot/test/src/filetest/c.txt");
		BufferedWriter writer = new BufferedWriter(new FileWriter(c, true));
		writer.write(aString + bString);
		ar.close();
		br.close();
		writer.close();
	}
}
